package com.competition.front.controller;


import com.competition.commonutils.R;
import com.competition.front.entity.Examination;
import com.competition.front.service.ExaminationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 知识竞赛测试表 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-03-30
 */
@RestController
@RequestMapping("/front/examination")
@CrossOrigin
@Api(description = "关于竞赛的接口")
public class ExaminationController {

    @Autowired
    private ExaminationService examinationService;

    @GetMapping("getAllExamination")
    @ApiOperation("获取全部竞赛，可通过竞赛id获取该竞赛相关的题目")
    private R getExamination(){
        List<Examination> examinationList = examinationService.list(null);
        return R.ok().data("examinationList",examinationList);
    }
}

